// mircoApp/tiktok_writeoff/components/equity.js
const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    datas: Object,
    status: {
      type: Number,
      value: 1
    },
    info:{},
  },
  observers: {
    'datas': function(newV) {
      if(newV){
        this.setData({
          info: newV
        })
      }
    }
  },
  /**
   * 组件的初始数据
   */
  data: {
    info: {},
    show_order: false,
    imgPath: app.globalData.imgPath,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    get_order(id) {
      app._getNetWork({
        url: app.getNetAddresss("plugin.tiktok-verify-ticket.api.record.detail"),
        data: {
          id
        },
        success: resdata => {
          let {
            result,
            msg,
            data
          } = resdata.data;
          if (result !== 1) {
            return app.tips(msg);
          }
          this.setData({
            show_order: true,
            info: data.right
          });
        }
      });
    },
    order_handle(e) {
      let order_id = e.currentTarget.dataset.order_id;
      wx.navigateTo({
        url: '/packageA/member/orderdetail/orderdetail?order_id=' + order_id,
      })
    },
    goto(e) {
      let type = e.currentTarget.dataset.type;
      let _url = {
        "point": "/packageB/member/integral/integral",
        "balance": "/packageA/member/balance/balance/balance",
        "love": "/packageB/member/love/Love_index/Love_index",
        "integral": "/packageB/member/Integral_love/Integral_love",
        "packet": "/packageC/redPacket/daily_red/daily_red",
        "exchange": "/packageI/redeem_code/center/center",
        "member_level": "/packageB/member/MemberGradeList/MemberGradeList"
      }
      wx.navigateTo({
        url: _url[type]
      });
    },
  }
})